package org.gfix.annotation;

import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;

import org.gfix.types.FixVersion;

/**
 * This annotation provides support to bind a single field to a single
 * FIX tag. This is the simplest case of binding.
 * 
 * The related field values allow simplistic binding of arrays of objects of the 
 * same type to a set of single single tags.
 *  
 * @author alan
 *
 */
@Documented
@Retention(RetentionPolicy.RUNTIME)
public @interface FixBinding 
{

	/**
	 * The version of FIX that this binding is applicable for.
	 * 
	 * @return
	 */
	public FixVersion fixVersion();
	
	/**
	 * The tag, this fields value is bound to
	 * @return
	 */
	public int fixTag();
	
	/**
	 * Sets the order the field should appear in the fix message.
	 * The default of 1000 is normally fine, however some
	 * engines may require the tags in a set order. 
	 * This should never be set to negative as these values 
	 * are reserved for system use.
	 * @return
	 */
	public int order() default 1000;
	
	/**
	 * Used to allow custom binding of the formatting 
	 * @return
	 */
	public FixFormatter formatter();
	
	/**
	 * Holds the name the related field 
	 * @return
	 */
	public String relatedField() default "";
	

	/**
	 * This holds the value the related field should be set to.
	 * @return
	 */
	public String relatedFieldValue() default "";
}
